home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / ATT.ZIP / MOONLIST.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-04-20  |  4.3 KB  |  126 lines

  1. VERSION 2.00
  2. Begin Form MoonList 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Moon Phases"
  5.    ClientHeight    =   1635
  6.    ClientLeft      =   3210
  7.    ClientTop       =   3180
  8.    ClientWidth     =   4380
  9.    ControlBox      =   0   'False
  10.    Height          =   2070
  11.    Left            =   3135
  12.    LinkTopic       =   "Form2"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1635
  16.    ScaleWidth      =   4380
  17.    Top             =   2820
  18.    Width           =   4530
  19.    Begin CommandButton Command1 
  20.       Caption         =   "OK"
  21.       Default         =   -1  'True
  22.       Height          =   330
  23.       Left            =   1590
  24.       TabIndex        =   0
  25.       Top             =   1020
  26.       Width           =   1170
  27.    End
  28.    Begin XListBox XList1 
  29.       Height          =   1005
  30.       ItemDefHeight   =   100
  31.       ItemInvert      =   -1  'True
  32.       Left            =   0
  33.       Top             =   0
  34.       Width           =   4365
  35.    End
  36. Option Explicit
  37. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  38. Sub Command1_Click ()
  39. Unload Me
  40. End Sub
  41. Sub Form_Load ()
  42. Dim OurDate As Variant
  43. Dim IDt As Variant
  44. Dim Yr As Integer
  45. Dim I As Integer
  46. Dim T As Long
  47. Dim Sel As Integer
  48. Dim LongMinus$, LatMinus$
  49. Dim Sunrise$, Sunset$
  50. Dim TT$
  51. Dim Start%
  52. If Not gShowingMoons Then
  53.    MoonList.Caption = "Sunrise & Sunset in " + gLocation
  54.    If TextWidth(MoonList.Caption) > MoonList.Width Then
  55.          MoonList.Width = TextWidth(MoonList.Caption) * 1.3
  56.    End If
  57. End If
  58. If gSettingsVisible Then
  59.    MoonList.Left = Settings.Left + (Settings.Width / 2) - (MoonList.Width / 2)
  60.    MoonList.Top = Settings.Top + (Settings.Height / 2) - (MoonList.Height / 2)
  61.    MoonList.Left = Screen.Width / 2 - (MoonList.Width / 2)
  62.    MoonList.Top = Screen.Height / 2 - (MoonList.Height / 2)
  63. End If
  64. Screen.MousePointer = 11
  65. OurDate = Date
  66. Yr = Year(OurDate)
  67. If gShowingMoons Then
  68.    Xlist1.ItemInvert = False
  69.    gMoons = 0
  70.    For I% = 1 To 12
  71.    Call CalcMoonPhases(Yr, I%, 1, 0, True)
  72.    Next I%
  73.    Xlist1.ItemDefHeight = AlltheTime.MoonPic.Height
  74.    For I = 1 To gMoons
  75.       Xlist1.AddItem gMoonList$(I) + " - " + MoonDescArr$(gMoonSubs(I) - 35)
  76.       Xlist1.ItemImage(I - 1) = AlltheTime.MoonSun.GraphicCell(gMoonSubs(I))
  77.       If DateValue(gMoonList$(I)) <= DateValue(SavedDat$) Then
  78.          Sel = I - 1
  79.       End If
  80.    Next I
  81.    Xlist1.ItemInvert = True
  82.    Xlist1.ItemDefHeight = AlltheTime.MoonPic.Height
  83.    If Right$(gLongitude, 1) = "E" Then LongMinus$ = "-" Else LongMinus$ = ""
  84.    If Right$(gLatitude, 1) = "S" Then LatMinus$ = "-" Else LatMinus$ = ""
  85.    For I% = 1 To TZs%
  86.       If InStr(TZ(I%), "(" + gTimezone + ")") <> 0 Then TT$ = TZ(I%)
  87.    Next I%
  88.    TT$ = Trim$(Mid$(TT$, InStr(TT$, ")") + 1, 200))
  89.    Start = InStr(TT$, ":")
  90.    If Start > 0 Then
  91.       TT$ = Format$(Val(Left$(TT$, Start - 1)) + Val(Mid$(TT$, Start + 1, 200)) / 100#)
  92.    End If
  93.    For I% = -183 To 183
  94.        If Val(gDSTAuto) Then
  95.           Call CalcDSTStartStop(OurDate + I%)
  96.           If (OurDate + I% >= DSTStart) And (OurDate + I% < DSTStop) Then
  97.              gDST = "-1"
  98.           Else
  99.              gDST = "0"
  100.           End If
  101.        End If
  102.        Call CalcSunRiseSet(LongMinus$ + Left$(gLongitude, Len(gLongitude) - 1), LatMinus$ + Left$(gLatitude, Len(gLatitude) - 1), Val(TT$), Val(gDST), OurDate + I%, Sunrise$, Sunset$)
  103.        Xlist1.AddItem Format$(OurDate + I%, "Long Date") + "  " + Sunrise$ + " " + Sunset$
  104.    Next I%
  105. End If
  106. 'Show
  107. T& = SendMessage(Xlist1.hWnd, LB_SETCURSEL, 183, 0&)
  108. T& = SendMessage(Xlist1.hWnd, LB_SETTOPINDEX, 183, 0&)
  109. Screen.MousePointer = 0
  110. End Sub
  111. Sub Form_Resize ()
  112. Dim Items As Integer
  113. If Height < Command1.Height * 6.4 Then Height = Command1.Height * 6.4
  114. If Width < Command1.Width * 2 Then Width = Command1.Width * 2
  115. Xlist1.Width = ScaleWidth
  116. Command1.Left = (ScaleWidth - Command1.Width) / 2
  117. Command1.Top = (ScaleHeight - Command1.Height * 1.5)
  118. Xlist1.Height = Command1.Top - Command1.Height / 2
  119. Items = Xlist1.Height \ Xlist1.ItemDefHeight
  120. Xlist1.Height = Items * Xlist1.ItemDefHeight + 30
  121. 'Command1.Top = (ScaleHeight - Command1.Height * 1.5)
  122. End Sub
  123. Sub XList1_Click ()
  124.     '
  125. End Sub
  126.